#!/bin/bash
source /etc/profile
. $BEETLE_SHELL_PATH/error.sh


workPath=/usr/local/db/cassandra
bakPath=/usr/beetle/appbak/cassandra


# bash $BEETLE_SHELL_PATH/bak.sh ${workPath} data ${bakPath} data || error_exit

cd ${workPath} || error_exit
tar -zcf ${bakPath}/data_`date +%Y%m%d-%H%M%S`.tgz data  || error_exit

cd ${bakPath} || error_exit

rm -rf `ls -t data_* |tail -n+11` || error_exit

ls -alh ${bakPath}/ 

